<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
var treeSelectedId="";
$(function(){
	$("#folderTree").tree({
		animate:false,
		lines:true,
		url:"<c:url value='/docCatalog/treeData' />",
		//queryParams:{"folderType":"<c:out value='${folderType}' />"},
		/*onBeforeLoad: function (node, param) {
			if (node) {
				param.parentId = node.id;
			}
		},*/
		onSelect:function(node){
			$('#showDiv').panel('refresh','<c:url value="/docCatalog/docCatalogShow" />?dcId='+node.id);
		},
		onLoadSuccess:function(node, data){
			$("#folderTree span[class^='tree-icon']").removeClass("tree-folder tree-folder-open tree-file");    	
			if($("#folderTree").tree("getSelected")==null){
				if(treeSelectedId==""){
					$("#folderTree").tree("select",$("#folderTree").tree("getRoot").target);
				}else{
					$('#folderTree').tree('select',  $('#folderTree').tree('find', treeSelectedId).target);
				}
			}
		}
	});
});